package com.ruoyi.business.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.HsBuildingMapper;
import com.ruoyi.business.domain.HsBuilding;
import com.ruoyi.business.service.IHsBuildingService;

/**
 * 楼栋Service业务层处理
 * 
 * @author asher
 * @date 2021-11-08
 */
@Service
public class HsBuildingServiceImpl implements IHsBuildingService 
{
    @Autowired
    private HsBuildingMapper hsBuildingMapper;

    /**
     * 查询楼栋
     * 
     * @param buildingId 楼栋主键
     * @return 楼栋
     */
    @Override
    public HsBuilding selectHsBuildingByBuildingId(Long buildingId)
    {
        return hsBuildingMapper.selectHsBuildingByBuildingId(buildingId);
    }

    /**
     * 查询楼栋列表
     * 
     * @param hsBuilding 楼栋
     * @return 楼栋
     */
    @Override
    public List<HsBuilding> selectHsBuildingList(HsBuilding hsBuilding)
    {
        return hsBuildingMapper.selectHsBuildingList(hsBuilding);
    }

    /**
     * 新增楼栋
     * 
     * @param hsBuilding 楼栋
     * @return 结果
     */
    @Override
    public int insertHsBuilding(HsBuilding hsBuilding)
    {
        hsBuilding.setCreateTime(DateUtils.getNowDate());
        return hsBuildingMapper.insertHsBuilding(hsBuilding);
    }

    /**
     * 修改楼栋
     * 
     * @param hsBuilding 楼栋
     * @return 结果
     */
    @Override
    public int updateHsBuilding(HsBuilding hsBuilding)
    {
        hsBuilding.setUpdateTime(DateUtils.getNowDate());
        return hsBuildingMapper.updateHsBuilding(hsBuilding);
    }

    /**
     * 批量删除楼栋
     * 
     * @param buildingIds 需要删除的楼栋主键
     * @return 结果
     */
    @Override
    public int deleteHsBuildingByBuildingIds(Long[] buildingIds)
    {
        return hsBuildingMapper.deleteHsBuildingByBuildingIds(buildingIds);
    }

    /**
     * 删除楼栋信息
     * 
     * @param buildingId 楼栋主键
     * @return 结果
     */
    @Override
    public int deleteHsBuildingByBuildingId(Long buildingId)
    {
        return hsBuildingMapper.deleteHsBuildingByBuildingId(buildingId);
    }
}
